﻿using System.Collections;
using Is.Ex;

namespace Is
{
    public static class IsCollectionFluentExtensions
    {
        public static bool Empty(this IIs<ICollection> iser)
        {
            return iser.Apply(
                t => t.Contains().Zero(),
                t => !t.Contains().Zero());
        }

        public static bool NullOrEmpty(this IIs<ICollection> iser)
        {
            return iser.Apply(
                t => Core.Is.Null(iser) || t.Contains().Zero(),
                t => Core.Is.NotNull(iser) && !t.Contains().Zero());
        }

        public static ContainsCollection Contains(this IIs<ICollection> iser)
        {
            return new ContainsCollection(iser.Target, iser.Negate);
        }
    }
}